/*
 * GroupListEntryRenderer.java
 *
 */
package com.sun.demo.addressbook;

import java.awt.Component;
import javax.swing.JList;
import javax.swing.ListCellRenderer;
import javax.swing.DefaultListCellRenderer;

/**
 *
 */
public class GroupListEntryRenderer extends DefaultListCellRenderer {
    public GroupListEntryRenderer() {
    }

    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
        super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
        
        GroupListEntry entry = (GroupListEntry) value;
        this.setText(entry.getName());
        return this;
    }
}
